package com.pointi.emoTools;

public class vasData
{	
	// ____________________________________________________________________________________________________
	// Voice Engine Data // Configuration

	
	public static final int _NONE = -1 ;
	public static final int _CLUSTER_A = 1 ;
	public static final int _CLUSTER_B = 2 ;
	public static final int _CLUSTER_C = 3 ;

	public int LEVEL ; // INPUT DATA LENGTH
	public int mSubtime = -1 ;
	public int mCluster = -1 ;
	public double [] mFeature ;

	// ____________________________________________________________________________________________________
	// Voice Engine Data // for K-Means Clustering

	public vasData()
	{
		this.LEVEL = 13 ;
		mSubtime = -1 ;
		mCluster = -1 ;
		mFeature = new double [LEVEL] ;
		for(int i=0; i<LEVEL; i++)
		{
			mFeature[i] = 0 ;
		}
	}
	public vasData(int inLEVEL)
	{
		this.LEVEL = inLEVEL ;
		mSubtime = -1 ;
		mCluster = -1 ;
		mFeature = new double [LEVEL] ;
		for(int i=0; i<LEVEL; i++)
		{
			mFeature[i] = 0 ;
		}
	}
	public vasData(double [] inData, int inLEVEL)
	{
		this.LEVEL = inLEVEL ;
		mFeature = new double [LEVEL] ;
		//System.out.println("A : " + this.LEVEL + " / " + mFeature.length) ;
		this.features(inData) ;
	}

	// ____________________________________________________________________________________________________
	// Voice Engine Data // INPUT & OUTPUT

	// POINT
	public void features(double [] inFeatures) { System.arraycopy(inFeatures, 0, mFeature, 0, LEVEL) ; }
	public double [] features() { return mFeature ; }	
	// CLUSTER
	public void cluster(int inCluster) { mCluster = inCluster ; }
	public int cluster() { return mCluster ; }
	// SUBTIME
	public void subtime(int inSubtime) { mSubtime = inSubtime ; }
	public int subtime() { return mSubtime ; }
	
	// ____________________________________________________________________________________________________
	// Voice Engine Data // UTILITY

	public void fnFeatureMerge(double [] inFeature)
	{
		for(int i=0; i<LEVEL; i++)
		{
			mFeature[i] += inFeature[i] ;
		}
	}
	public double [] fnFeatureAverage(int inCNT)
	{
		for(int i=0; i<LEVEL; i++)
		{
			mFeature[i] /= inCNT ;
		}
		return mFeature ;
	}
	
	// ____________________________________________________________________________________________________
	// EOC
}
